<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />
  
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet" >
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet" >
  
  <title></title>
  
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>

  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default seededu-panel seededu-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx}/users">用户管理</a></li>
          <li class="active">学生管理</li>
        </ol>
      </div>

      <div class="panel-body">
      
        <div class="col-xs-2 seededu-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 seededu-panel-layout-right">

          <div class="seededu-breadcrumb-wrapper">
            <div class="seededu-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-sort-by-attributes" title=""></i>&nbsp;&nbsp;<span> 用户管理&nbsp;-&nbsp;学生管理</span></h2>
            </div>
          </div>
          
          <div class="seededu-toolbar-wrapper clearfix">
            <div class="btn-toolbar pull-right">
              <div class="btn-group">
                <a href="${ctx}/students/create" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" title="添加学生" data-toggle="modal" data-target="#">
                  <i class="glyphicon glyphicon-plus"></i>&nbsp;添加学生
                </a>
                <a href="${ctx}/students/search" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" title="过滤查询" data-toggle="modal" data-target="#">
                  <i class="glyphicon glyphicon-search"></i>&nbsp;查&nbsp;&nbsp;询
                </a>
              </div>
            </div>
          </div>

          <table class="table table-striped table-hover demo2do-table">
            <thead>
              <tr>
                <th>Uid</th>
                <th>Name</th>
                <th>School</th>
                <th>Grade</th>
                <th>Email</th>
                <th>Cellphone</th>
                <th>Project</th>
                <th>Edit</th>
              </tr>
            </thead>
            <tbody class="dele" id="shuju">
              <c:if test="${totalCount le 0 }">
                <tr>
                  <td colspan="8">目前还没有用户数据</td>
                </tr>
              </c:if>
              <c:if test="${totalCount gt 0}">
                <c:forEach items="${list}" var="u">
                  <tr>
                    <td>${u.suid }</td>
                    <td>${u.name }</td>
                    <td><a href="${u.school.schoolId }/detail">${u.school.schoolNAME }</a></td>
                    <td>${u.grade }</td>
                    <td>${u.email }</td>
                    <td>${u.cellPhone }</td>
                    <td><c:forEach items="${u.subProjects}" var="pu">
                        <a href="${pu.spid}/detail">${pu.name }</a>
                        <br>
                      </c:forEach></td>
                    <td><a href="${ctx }/student/${u.suid }/detail">详情</a>&nbsp;<a onclick='{if(confirm("您确定删除此条信息吗?")){return true;}return false;}' href="${ctx }/student/${u.suid }/delStu">删除</a></td>
                  </tr>
                </c:forEach>
              </c:if>
            </tbody>
          </table>

        </div>

      </div>

    </div>
    
  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx}/static/js/select2.min.js"></script>
  <script src="${ctx}/static/js/select2_locale_zh-CN.js"></script>
  
</body>
</html>
